/*
 * Alloy Analyzer
 * Copyright (c) 2002 Massachusetts Institute of Technology
 *
 * The Alloy Analyzer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The Alloy Analyzer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with the Alloy Analyzer; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package alloy.ast;

import java.util.List;

/**
 * Common supertype to {@link alloy.ast.Predicate}s and
 * {@link alloy.ast.Function}s.
 */
public abstract class InvocablePara extends FormulaPara {

    /** a counter for generating unique result argument names */
    public int resultCounter = 0;

    /**
     * index of argList in child list
     */
    private static final int ARGLIST_INDEX = 2;

    /** a list of the argument types of this */
    private List argTypes;

    protected InvocablePara(Location location_, QualifiedName name_, FormulaSeq formula_, ArgList argList_) {
        super(location_, name_, formula_);
        addChild(argList_);
    }

    protected InvocablePara(QualifiedName name_, FormulaSeq formula_, ArgList argList_) {
        this(Location.UNKNOWN, name_, formula_, argList_);
    }

    /**
     * gets the argList of this
     * @return the {@link ArgList}
     */
    public ArgList getArgList() {
        return (ArgList)childAt(ARGLIST_INDEX);
    }

    /** set the ArgList of this */
    public void setArgList(ArgList newChild_) {
        setChild(ARGLIST_INDEX, newChild_);
    }
}
